package com.cy.dao;

import com.cy.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SysUserDao {
    List<SysUser> selectSysUser(@Param("username") String username);

    @Update("update sys_user set valid=#{valid}," +
            "modifiedUser=#{modifiedUser}," +
            "modifiedTime=now() where id=#{id}")
    int userDisable(Integer id,Integer valid,String modifiedUser);

    SysUser selectById(Integer id);

    int updateUser(SysUser sysUser);

    int insertUser(SysUser sysUser);

    @Select("select * from sys_users where username=#{username}")
    SysUser selectUserByUsername(String username);
}
